<template>
	<div class="approval_list">
		<el-tabs class="custom_top" v-model="activeName">
			<el-tab-pane label="待审核" name="1"></el-tab-pane>
			<el-tab-pane label="已审核" name="2"></el-tab-pane>
		</el-tabs>
		<el-table :data="tableData"></el-table>
		<sw-pagination :total="dataCount" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @change="handlePageChange"></sw-pagination>
	</div>
</template>

<script>
export default {
	data() {
		return {
			activeName: '1',
			dataCount: 0,
			listQuery: {
				page: 1,
				limit: 10
			},
			tableData: []
		};
	},
	watch: {
		activeName(val) {
			this.listQuery.page = 1;
			if (val === '1') {
				this.getWaitAuditResource();
			} else if (val === '2') {
				this.getYetAuditResource();
			}
		}
	},
	methods: {
		//获取待审核资源
		async getWaitAuditResource() {},

		//获取已审核资源
		async getYetAuditResource() {},

		//分页切换事件
		handlePageChange() {
			if (val === '1') {
				this.getWaitAuditResource();
			} else if (val === '2') {
				this.getYetAuditResource();
			}
		}
	}
};
</script>

<style lang="scss" scoped>
.approval_list {
	display: flex;
	flex-direction: column;
	padding: 0 10px;
	height: 100%;
	.el-tabs {
		flex-shrink: 0;
	}
}
</style>
